<template>
  <div>
    <div id="bigbox">
      <div class="boxa">
        <span class="ml">目录</span><span class="gong">（共计21篇文章）</span>
      </div>
      <div>
        <van-popover
          v-model="showPopover"
          trigger="click"
          :actions="actions"
          @select="onSelect"
        >
          <template #reference>
            <div class="anniu">
              <van-button   type="primary"  
                >全部 <span  class="iconfont icon-xiajiantou"></span
              ></van-button>
            </div>
          </template>
        </van-popover>
      </div>
    </div>
  </div>
</template>

<script>
import { Toast } from "vant";
export default {
  data() {
    return {
      showPopover: false,
      // 通过 actions 属性来定义菜单选项
      actions: [{ text: "全部" }, { text: "词根篇" }, { text: "场景篇" }],
    };
  },
  methods: {
    onSelect(action) {
      Toast(action.text);
    },
  },
};
</script>

<style scoped>
#bigbox {
  width: 3.42rem;
  margin: 0 auto;
  /* background: rgb(214, 64, 89); */
  height: 0.55rem;
  display: flex;
  border-bottom: 1px solid gainsboro;
  justify-content: space-between;
  align-items: center;
}
.anniu {
  display: flex;
}
.ml {
  font-size: 0.18rem;
  font-weight: 600;
}

.icon-xiajiantou {
  font-size: 0.12rem;
}
.van-button--primary {
    color: #fff;
    background-color: #f3eded;
    border: 1px solid #cacaca;
    font-size: .12rem;
    color: rgb(160, 158, 158);
    height: .2rem;
}
.gong {
  font-size: 0.12rem;
}
</style>